<?php 
session_start();
require_once 'header.php';
require_once 'securimage/securimage.php';
$webroot="";
function __autoload($className)
	{
    	require_once('class/' . $className . '.class.php');
	}
session::need_member();
$userId=session::getuserid();
if($userId != 0)
{
	if(!empty($_POST['batchLr']))
	{
		$captcha=rtrim(trim($_POST["captchaCode"]));
		$operation=$_SESSION["verifyResult"];
		if($captcha !=$operation)
		{
			echo $operation."-".$captcha;
			?>
			<script type="text/javascript" >
			alert("Incorrect Answer");
			window.location.reload();
			
			</script>
			
			<?php
		}
		else 
		{
			
		$dateb4=date("Y-m-d");
		$batch=rtrim(trim($_POST['batchLr']));
		$batchLr=strval($batch);
		$verify=user::checkGetFreeCc($userId, $batchLr);
		if($verify==2)
		{
			echo "<font color='red'>Can not Find your batch of payment, make sure that you have deposited with this batch <br/> 
			MAKE SURE ONLY THE PAYMENT WHICH YOU HAVE DEPOSITED TODAY ( $dateb4 ), AND OVER 10$, CAN BE USED</font>";
			
		}
		else if($verify==0)
		{
			?>
			<script type="text/javascript" >
			alert("Your batch has been used");
			window.location.reload();
			
			</script>
			
			<?php
		}
		else if($verify==1)
		{
			// get it
			$getCc=database::LimitQuery("ccfree",array(
			'select' => 'info,id',
			'condition' => array(
			'is_view' => 'N'
			),
			'offset' => '0',
			'size' => '10',
			'order' => 'order by rand()',
			));
			$insert=array(
			'userid' => $userId,
			'date' => $dateb4,
			'batch' => $batchLr
			);
			echo "<textarea cols='120' rows='20'>";
			$insertGetCc=database::Insert("get_cc_free", $insert);
			$ccid=array();
			foreach($getCc as $showCc)
			{
				$ccid[]=$showCc['id'];
				echo $showCc['info']."\n";
			}
			echo "</textarea>";
			$update=database::Update("ccfree",array(
			'id' => $ccid
			),array(
			'is_view' => 'Y'
			
			));
		}
		}
	}
	elseif (!empty($_POST["getbatchlr"]))
	{
		?>

		* You can get batch of payment in your liberty reserve account <br/>
		* Only the batch of payment which you have <b>DEPOSITED TODAY</b>, and <b>OVER 10$ </b> can be used here <br/>
		* All Cc get can are <b>FREE</b>, and we not sure about the quality, but im sure that <b>SOME OF THEM CAN BE USE</b> <br/>
		* With every batch of payment, you only can use 1 time in here <br/>
		* You can get <b>10 free Cvv per time </b> <br/>

		<?php
	}
	
}
?>